<!DOCTYPE html>
<html>
<head>
  <title></title>
<style type="text/css">
  body{font-family: 宋体;font-size: 14px;}
  .title{font-size: 18px; text-align: center;}
  .m-b-10{clear: both;margin-bottom: 10px;}
  .m-b-15{clear: both;margin-bottom: 15px;}
   table,table tr th, table tr td { border:1px solid #000;text-align: center }
  table{width: 100%;border-collapse: collapse;};
  .textline{font-size: 12px;}

</style>
</head>
<body>
     <h5 class="title">青岛思锐源创能源科技有限公司结算单</h5>
            <p class="textline">
              委托书号:{{$data->code}}&nbsp;&nbsp;&nbsp;结算日期:{{$data->created_at->format('Ymd')}}&nbsp;&nbsp;&nbsp; 付款方式:{{$data->balance_type}}&nbsp;&nbsp;&nbsp; 接待顾问:{{object_get($data,'worker.truename')}}
            </p>                     
            <table class="m-b-15">
               <!--  <tr>
                  <td>资产编号</td>
                  <td><strong>{{$data->title}}</strong></td>
                </tr> -->
                <tr>
                  <td>托修单位</td>
                  <td>{{object_get($data,'client_name')}}</td>
                  <td>车型</td>
                  <td>{{object_get($data,'car_brand')}}</td>
                  <td>牌照号</td>
                  <td>{{object_get($data,'car_num')}}</td>
                  <td>进场日期</td>
                  <td>{{$data->arrived_at}}</td>
                 
                </tr>
                <tr>
                  <td>行驶里程</td>
                  <td>{{$data->miles}}</td>
                  <td>电话</td>
                  <td>{{$data->phone}}</td>
                  <td>送修人</td>
                  <td>{{$data->name}}</td>
                  <td>完工时间</td>
                  <td>{{date('Y-m-d',strtotime($data->completed_at))}}</td>
                </tr>
               
                
              </table>

              <table class="m-b-15">
                <tr>
                  <th colspan="5">维修项目</th>
                </tr>
                <tr>
                  <td>序号</td>
                 
                  <td>项目名称</td>

                  <td>折扣率</td>
                  <td>工时费</td>
                  
                  <td>备注</td>
                </tr>
                @foreach($data->service as $k=>$s)
                <tr>
                  <td>{{$k+1}}</td>
                 
                  <td>{{object_get($s,'service_name')}}</td>
                 <td>{{$s->discount}}</td>
                  <td>{{$s->service_price}}</td>
                 
                  <td></td>
                </tr>
                @endforeach
                <tr>
                  <td colspan="3" style="text-align: right">合计</td>
                  <td colspan="2">{{$data->service->sum('service_price')}}</td>
                  
                </tr>
              </table>

              <table class="m-b-10">
                <tr>
                  <th colspan="7">材料清单</th>
                </tr>
                <tr>
                  <td>序号</td>
                
                  <td>材料名称</td>
                  <td>单位</td>
                  <td>数量</td>
                  <td>单价</td>
                  <td>折扣率</td>
                  <td>合计</td>
                  
                 
                </tr>
                @foreach($data->depart as $key=>$p)
                <tr>
                  <td>{{$key+1}}</td>
                 
                  <td>{{object_get($p,'depart_name')}}</td>
                  <td><!--材料单位--></td>
                  <td>{{$p->depart_num}}</td>
                  <td>{{$p->depart_price}}</td>
                  <td>{{$p->discount}}</td>
                  <td>{{$p->total_price}}</td>
                  
                 
                </tr>
                @endforeach
                <tr>
                  <td colspan="5" style="text-align: right">合计</td>
                  <td colspan="2">{{$data->depart->sum('total_price')}}</td>
                  
                </tr>
              </table>

              <table class="m-b-10">
                <tr>
                  <td>应收大写</td>
                  <td>{{$total_money_cny}}</td>
                  <td>应收合计</td>
                  <td>{{$data->total_money}}</td>
                  @if($data->rate>0)
                  <td>折扣率</td>
                  <td>{{$data->rate}} 折</td>
                  @endif
                  <td>实收大写</td>
                  <td>{{$total_price_cny}}</td>
                  <td>实收合计</td>
                  <td>{{$total_price}}</td>
                </tr>
              </table>
              <p class="textline">
                结算人：{{session('admin')->truename}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;收款人：_________
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客户签名：________
              </p>

          
</body>
</html>

          
                             
           
              
              
            
               

                  
            
        
       

           



    
        
    
